<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
      <%@ page import="java.sql.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>酒店1信息</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String 用户姓名 = request.getParameter("name");
String 电话号码 = request.getParameter("phone");
String 入店日期 = request.getParameter("indate");
String 离店日期 = request.getParameter("outdate");
String 备注 = request.getParameter("remarks");
Class.forName("org.mariadb.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mariadb://10.220.140.102:3366/studb11","stua","zHZUA65r");
Statement stmt = connection.createStatement();
String sql = "INSERT INTO jiudian1(name,phone,indate,outdate,remarks) VALUE('"+用户姓名+"','"+电话号码+"','"+入店日期+"','"+离店日期+"','"+备注+"')";
System.out.println("sql=" + sql);
int r = stmt.executeUpdate(sql);
System.out.println("影响行数为:"+ r);

stmt.close();
connection.close();

response.sendRedirect("hotel1-details.jsp");



%>


</body>
</html>